﻿#region License
/*

	Copyright (C) 2008 Oliver Charles, Daniel Hollander

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
	
*/
#endregion

using System.Drawing;

namespace Overload
{
    /// <summary>
    /// Some type of Tile in the world
    /// </summary>
    public interface ITile
    {
        /// <summary>
        /// Get the coordinates of this tile, in world space
        /// </summary>
        Point WorldCoordinates { get; }

        /// <summary>
        /// The cost to move into this tile
        /// </summary>
        int MovementCost { get; }
    }

    /// <summary>
    /// A tile is one piece of the world
    /// </summary>
    public sealed class Tile : ITile
    {
        #region Properties

        private readonly Point hexCoordinates;
        private TileType tileType;

        /// <summary>
        /// The location of this tile, in hex-space
        /// </summary>
        public Point WorldCoordinates
        {
            get { return hexCoordinates; }
        }

        public int MovementCost
        {
            get { return tileType.MovementCost;  }
        }

        public TileType TileType
        {
            get { return tileType; }
            set { tileType = value; }
        }

        #endregion
        #region Constructors

        /// <summary>
        /// Create a new tile
        /// </summary>
        /// <param name="tileHexCoordinates">The location of the tile in hex space</param>
        public Tile(Point tileHexCoordinates)
        {
            hexCoordinates = tileHexCoordinates;
        }

        #endregion
    }
}